package cn.project.domain.activity.service.quota;

import cn.project.domain.activity.model.entity.ActivityCountEntity;
import cn.project.domain.activity.model.entity.ActivityEntity;
import cn.project.domain.activity.model.entity.ActivitySkuEntity;
import cn.project.domain.activity.repository.IActivityRepository;
import cn.project.domain.activity.service.quota.rule.chain.factory.DefaultActivityChainFactory;

/**
 * @author xu
 * @description 抽奖活动的支撑类
 * @date 2025/7/17
 */

public class RaffleActivityAccountQuotaSupport {
    /**
     * 引入责任链
     */
    protected DefaultActivityChainFactory defaultActivityChainFactory;
    /**
     * 引入仓储服务
     */
    protected IActivityRepository activityRepository;

    /**
     * 构造配置
     * @param activityRepository
     * @param defaultActivityChainFactory
     */
    public RaffleActivityAccountQuotaSupport(IActivityRepository activityRepository, DefaultActivityChainFactory defaultActivityChainFactory) {
        this.activityRepository = activityRepository;
        this.defaultActivityChainFactory = defaultActivityChainFactory;
    }

    public ActivitySkuEntity queryActivitySku(Long sku) {
        return activityRepository.queryActivitySku(sku);
    }

    public ActivityEntity queryRaffleActivityByActivityId(Long activityId) {
        return activityRepository.queryRaffleActivityByActivityId(activityId);
    }

    public ActivityCountEntity queryRaffleActivityCountByActivityCountId(Long activityCountId) {
        return activityRepository.queryRaffleActivityCountByActivityCountId(activityCountId);
    }
}
